import {configureStore, createSlice} from "@reduxjs/toolkit";

const appSlice = createSlice({
  name: "app",
  initialState: {
    settingVisible: false
  },
  reducers: {
    storeSimple(state, action) {
      return {...state, ...action.payload};
    },
    storeSetSettingVisible(state, action) {
      return {...state, settingVisible: action.payload};
    }
  }
  // extraReducers: {}
});

// # store.js
const store = configureStore({
  reducer: appSlice.reducer
});

export const {storeSimple, storeSetSettingVisible} = appSlice.actions;
export default store;